Communication on computer networks is frequently done utilizing secure communication techniques. By way of example, people frequently purchase goods and services over the Internet utilizing secure communications links. Data transferred over such a secure link is described by an Internet Protocol (IP) address, protocol, and ports, and a security association is established using an Internet Protocol Security (IPsec) protocol. The security association continues until it is no longer needed. Generally, an IPsec security association lasts until either a specified amount of traffic has been transmitted using the association or a specified amount of time has passed. These techniques of determining the duration of the security association are sufficient for long-lived security associations that may be renegotiated multiple times. However, a person contacting a web site over the Internet utilizing, for example, a home computer to make a purchase, generally does not visit that web site for an extended period of time before moving on, either by going to another web site or by closing the connection to the Internet. After such a client has left the web site, the IPsec driver for the web site maintains the security association as active. Lifetime management based on the amount of traffic or the amount of time thus results in the security association being maintained for longer than is necessary. One solution to this is for the IPsec driver to periodically remove idle security associations which have not been used to protect any inbound traffic for some predetermined amount of time. However, this may expire security associations that are still in use, for example, by someone merely observing activity on a web site. In any event, this idle detection could be made more efficient and could be done in a more timely manner if the IPsec driver had some context information it could correlate with the security association.